package com.chhuang.huaao.thread;

import java.util.Set;

import com.chhuang.system.consts.SysConstants;
import com.chhuang.utils.config.SysConfig;

public class ClearPushSetThread implements Runnable {
	
	private Set<String> set;
	private String value;
	
	public ClearPushSetThread(Set<String> set, String value){
		this.set = set;
		this.value = value;
	}

	@Override
	public void run() {
		if(set==null || set.isEmpty() || !set.contains(value)){
			return ;
		}
		
		long msec = SysConfig.getLong(SysConstants.Config.CLEAR_PUSH_SET_TIME, 1200000l);
		try {
			Thread.sleep(msec);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		//休眠完成后删除set中的value
		set.remove(value);
	}

}
